<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    img {
        width: 100px;
    }
</style>

<body>

    <h1>结算</h1>

    <div>

    </div>

    <h3></h3>
</body>
<script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
<script>
    var a = JSON.parse(localStorage.getItem('sp'))
    var b = localStorage.getItem('zj')
    console.log(a, b);
    a.forEach(i => {
        $('div').append(`
            <h4>名字:${i.name}</h4>
             <h4>价格:${i.price}</h4>
            <img src="${i.img}">
            `)
    });

    $('h3').html(`总价${b}`)
</script>

</html>